/*
* created by Administrator on 2018/11/20
* 好的代码像粥一样,是得用时间和精力熬的。
*/
var navBox = document.getElementsByClassName('nav_box')[0];
var navItem = document.getElementsByClassName('a1');
var sidebarReturn = document.getElementsByClassName('sidebar--return')[0];
var navImage = document.getElementsByClassName('nav--image')[0];
var currentY = 0;
window.onscroll = function () {
  currentY = document.documentElement.scrollTop;
    if(currentY > 60){
        for(var i = 0; i < navItem.length; i++){
            navItem[i].style.color = '#434242';
        }
        navBox.style.background = '#fff';
        navImage.src = '../img/first_images/iphone_logo.png';
    } else if(currentY === 0){
        for(var j = 0; j < navItem.length; j++){
            navItem[j].style.color = '#fff';
        }
        navBox.style.background = 'unset';
        navImage.src = '../img/first_images/145x45baise.png';
    }if(currentY >= 650){
        sidebarReturn.style.display = 'block';
    }else if(currentY < 650){
        sidebarReturn.style.display = 'none';
    }
};
